(function(jQuery, window, undefined){
    hljs.configure({
        tabReplace: '',
    });
    hljs.initHighlightingOnLoad();

    $('.example').hover(function(){
        var _this = $(this);
        setTimeout(function(){
            _this.addClass('hover');
        },30);
    },function(){
        var _this = $(this);
        setTimeout(function(){
            _this.removeClass('hover');
        },30);
    });
    $('.example-code-more').on('click', function(){
        var $i = $(this).find('i'),
            $span = $(this).find('span'),
            $code = $(this).siblings('.example-code');
        if($i.is('.glyphicon-triangle-bottom')){
            $i.removeClass('glyphicon-triangle-bottom').addClass('glyphicon-triangle-top');
            $span.text('Hide Code');
            $code.slideDown('3000');
        }else{
            $i.removeClass('glyphicon-triangle-top').addClass('glyphicon-triangle-bottom');
            $span.text('Show Code');
            $code.slideUp();
        }
    });
})(jQuery, window);